package com.sq.auth.common.enums;

import lombok.Getter;

/**
 * @author quan
 */
@Getter
public enum AuthUserStatusEnum {
    OPEN(0,"启用"),
    CLOSE(1,"禁用");

    private int code;
    private String desc;

    AuthUserStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AuthUserStatusEnum getByCode(int code) {
        for (AuthUserStatusEnum value : AuthUserStatusEnum.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
